import request from '@/utils/request'

// 查询供应商列表
export function listSupplier(query) {
  return request({
    url: '/business/supplierCategory/list',
    method: 'get',
    params: query
  })
}

// 查询供应商详细
export function getSupplier(id) {
  return request({
    url: '/business/supplierCategory/' + id,
    method: 'get'
  })
}

// 新增供应商
export function addSupplier(data) {
  return request({
    url: '/business/supplierCategory',
    method: 'post',
    data: data
  })
}

// 修改供应商
export function updateSupplier(data) {
  return request({
    url: '/business/supplierCategory',
    method: 'put',
    data: data
  })
}

// 删除供应商
export function delSupplier(id) {
  return request({
    url: '/business/supplierCategory/' + id,
    method: 'delete'
  })
}

// 查询欠款供应商列表（示例过滤方法，实际需根据后端实现）
export function listArrearsSupplier(query) {
  // 这里使用普通列表接口，前端过滤欠款供应商
  return request({
    url: '/business/supplierCategory/list',
    method: 'get',
    params: query
  })
} 